"""Added account table

Revision ID: 7b8398785148
Revises: 
Create Date: 2024-04-29 12:47:01.897834

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '7b8398785148'
down_revision: Union[str, None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('user',
    sa.Column('id', sa.BigInteger(), nullable=False),
    sa.Column('username', sa.String(length=64), nullable=False),
    sa.Column('tg_user_id', sa.BigInteger(), nullable=False),
    sa.Column('first_name', sa.String(length=64), nullable=True),
    sa.Column('last_name', sa.String(length=64), nullable=True),
    sa.Column('registered_at', sa.DateTime(), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('first_name'),
    sa.UniqueConstraint('id'),
    sa.UniqueConstraint('last_name'),
    sa.UniqueConstraint('tg_user_id'),
    sa.UniqueConstraint('username')
    )
    op.create_table('game_profile',
    sa.Column('id', sa.BigInteger(), nullable=False),
    sa.Column('user_id', sa.BigInteger(), nullable=False),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id'),
    sa.UniqueConstraint('user_id')
    )
    op.create_table('binary_converter',
    sa.Column('id', sa.BigInteger(), nullable=False),
    sa.Column('total_try_convert_word_in_byte', sa.Integer(), nullable=True),
    sa.Column('total_try_convert_byte_in_word', sa.Integer(), nullable=True),
    sa.Column('count_encrypted_characters', sa.Integer(), nullable=True),
    sa.Column('count_encrypted_word', sa.Integer(), nullable=True),
    sa.Column('number_decoded_characters', sa.Integer(), nullable=True),
    sa.Column('number_decoded_word', sa.Integer(), nullable=True),
    sa.Column('game_profile_id', sa.BigInteger(), nullable=False),
    sa.ForeignKeyConstraint(['game_profile_id'], ['game_profile.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('game_profile_id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('guess_number',
    sa.Column('id', sa.BigInteger(), nullable=False),
    sa.Column('best_result', sa.Integer(), nullable=True),
    sa.Column('total_number_games', sa.Integer(), nullable=True),
    sa.Column('game_profile_id', sa.BigInteger(), nullable=False),
    sa.ForeignKeyConstraint(['game_profile_id'], ['game_profile.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('game_profile_id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('haort_pyramid',
    sa.Column('id', sa.BigInteger(), nullable=False),
    sa.Column('game_difficulty', sa.Integer(), nullable=False),
    sa.Column('best_result', sa.JSON(), nullable=True),
    sa.Column('total_number_permutations', sa.Integer(), nullable=True),
    sa.Column('total_number_games', sa.Integer(), nullable=True),
    sa.Column('game_profile_id', sa.BigInteger(), nullable=False),
    sa.ForeignKeyConstraint(['game_profile_id'], ['game_profile.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('game_difficulty'),
    sa.UniqueConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('haort_pyramid')
    op.drop_table('guess_number')
    op.drop_table('binary_converter')
    op.drop_table('game_profile')
    op.drop_table('user')
    # ### end Alembic commands ###
